Skip to content

fix: add timeouts to model fetchers and send router models incrementally#11748

Draft
roomote[bot] wants to merge 1 commit intomainfrom
fix/router-models-timeout-incremental
Draft

fix: add timeouts to model fetchers and send router models incrementally#11748
roomote[bot] wants to merge 1 commit intomainfrom
fix/router-models-timeout-incremental

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Feb 26, 2026

Related GitHub Issue

Closes: #11747

Description

This PR attempts to address Issue #11747 where blocked DNS for provider domains (e.g. openrouter.ai, router.requesty.ai) caused all providers to hang until the DNS timeout expired, preventing even working providers from being usable.

Two changes:

  1. Add 10-second timeout to axios.get() calls in openrouter.ts, requesty.ts, unbound.ts, and vercel-ai-gateway.ts fetchers. The roo.ts fetcher already had a 10-second AbortController timeout, and litellm.ts already had a 5-second axios timeout.

  2. Send router models incrementally in the requestRouterModels handler: each provider posts its models to the webview as soon as it resolves, rather than waiting for all providers to finish via Promise.allSettled. A final aggregated message is still sent for backward compatibility.

This means providers with working DNS will have their models available immediately in the UI, while providers with blocked DNS will time out after 10 seconds and fail gracefully in the background.

Feedback and guidance are welcome.

Test Procedure

  • All existing tests pass (27 tests across webviewMessageHandler.spec.ts, webviewMessageHandler.routerModels.spec.ts, and 87+6 in ClineProvider.spec.ts)
  • To manually verify: block DNS for openrouter.ai and similar domains, then observe that providers like OpenAI/Ollama respond promptly without waiting for blocked providers

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates.
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Documentation Updates

No documentation updates needed. This is an internal behavior change that does not affect user-facing APIs or configuration.

Interactively review PR in Roo Code Cloud

Addresses #11747 where blocked DNS for provider domains (e.g. openrouter.ai,
router.requesty.ai) caused all providers to hang until the DNS timeout expired,
even for providers with working DNS.

Changes:
1. Add 10-second timeout to axios.get() calls in openrouter.ts, requesty.ts,
   unbound.ts, and vercel-ai-gateway.ts fetchers. The roo.ts and litellm.ts
   fetchers already had timeouts.

2. Send router models incrementally in the requestRouterModels handler: each
   provider posts its models to the webview as soon as it resolves, rather
   than waiting for all providers to finish via Promise.allSettled. A final
   aggregated message is still sent for backward compatibility.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Unavailable providers prevent others from immediately working

2 participants